//
//  Person.m
//  05-HomeWork
//
//  Created by dllo on 16/7/8.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "Person.h"

@implementation Person


- (instancetype)initWithName:(NSString *)name
                         age:(NSInteger)age
                         sex:(NSString *)sex {
    self = [super init];
    if (self) {
        _name = name;
        _age = age;
        _sex = sex;
    }
    return self;
}
- (NSString *)description {
    return [NSString stringWithFormat:@"%@--%ld--%@", _name, _age, _sex];
}
- (NSComparisonResult)compareWithAge:(Person *)person {
    return [self.name compare:person.name];
}
- (NSComparisonResult)compareWithName:(Person *)person {
    return self.age; 
}
- (NSComparisonResult)compareWithSex:(Person *)person {
    return [self.sex compare:person.sex];
}
@end
